import { rcaNumberFormat } from './common.js'
import { dateFormat } from '@/util/date';
import { commonTableOption } from './common.js'

function noDiff (val) {
  return val === undefined || val === 0
}
export const startDate = dateFormat(new Date(), 'yyyy-MM-') + '01';
export const endDate = dateFormat(new Date(), 'yyyy-MM-dd');

export const orderType = [
  {
    label: '转账',
    value: '1'
  },
  {
    label: '团购',
    value: '2'
  },
  {
    label: '平台',
    value: '3'
  }
]

export const paymentType = [
  {
    label: '现金支付',
    value: '10'
  },
  {
    label: '支付宝支付',
    value: '12'
  },
  {
    label: '微信支付',
    value: '13'
  },
  {
    label: '银行转账',
    value: '14'
  }
]
// 1：原始录入 2：手工录入 3：批量导入
export const dataType = [
  {
    label: '原始录入',
    value: '1'
  },
  {
    label: '手工录入',
    value: '2'
  },
  {
    label: '批量导入',
    value: '3'
  }
]

export const confirmStatus = [
  {
    label: '未确认',
    value: '0'
  }, {
    label: '已确认',
    value: '1'
  }
]

export const orderType1TableOption = {
  ...commonTableOption,
  selection: true,
  menu: true,
  editBtn: false,
  delBtn: false,
  selectable: (row, index) => {
    return (
      row.confirmStatus === '0'
    );
  },
  column: [{
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    search: true,
    cascaderItem: ['stationCode'],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dict',
  }, {
    type: 'select',
    label: '站点',
    prop: 'stationCode',
    search: true,
    props: {
      label: 'name',
      value: 'code'
    },
    dicFlag: false,
    dicUrl: `/support/swparamstation/dict/{{key}}`,
  }, {
    type: 'select',
    label: '票种',
    prop: 'ticketType',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckelectronicreceipt/ticketType',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选票种',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'input',
    showSummary: true,
    label: '售卖张数',
    prop: 'saleNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '票价',
    prop: 'unitTicketPrice',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '售卖金额 ',
    width: "100px",
    prop: 'saleAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "150px",
    label: '银行电子回执单金额',// 银行电子回执单金额 编辑时赋值 转账和团购编辑此值
    prop: 'bankElecOrderAmount',
    rules: [{
      required: true,
      message: '请输入银行电子回执单金额',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    width: "250px",
    label: '银行电子回执单与售卖金额差异',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
    prop: 'diffElecAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "120px",
    label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
    prop: 'bankAccountBalance',
    rules: [{
      required: true,
      message: '请输入银行账户金额',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "250px",
    label: '银行电子回执单与银行账户金额差异',// 编辑时赋值 转账和团购编辑此值
    prop: 'diffAccountAmount',
    editDisabled: true,
    disabled: true,
    // }, {
    //
    // type: 'input',
    showSummary: true,
    //   label: '电子回执单类型 1：转账 2：团购 3：平台 取票方式为线下核销的【0】，赋值3 平台 取票方式为转账的【1】，赋值 1 转账 从团购查询的，赋值2 团购',
    //   prop: 'returnOrderType'
  }, {
    type: 'date',
    label: '记账日期',
    prop: 'bookkeepingTime',
    editDisabled: true,
    disabled: true,
    searchSpan: 12,
    searchRange: true,
    search: true,
    searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    type: 'input',
     width: "150px",
    label: '回执单号/订单号',
    prop: 'returnNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '对账状态',
    prop: 'confirmStatus',
    dicData: confirmStatus,
    search: true,
  }]
}

export const orderType2TableOption = {
  ...commonTableOption,
  selection: true,
  menu: true,
  editBtn: false,
  delBtn: false,
  selectable: (row, index) => {
    return (
      row.confirmStatus === '0'
    );
  },
  column: [{
    type: 'select',
    label: '线路名称',
    prop: 'lineCode',
    editDisabled: true,
    disabled: true,
    dicQuery: { allLine: true },
    cascaderItem: ['stationCode'],
    dicUrl: '/rca/swckbankcashpaymentnote/listAllSubWayLine',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选择线路',
        trigger: 'blur'
      }
    ],
  }, {
    type: 'select',
    label: '站点名称',
    prop: 'stationCode',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckbankcashpaymentnote/listSubWayStation?lineCode={{key}}',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选站点',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'select',
    label: '票种',
    prop: 'ticketType',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckelectronicreceipt/ticketType',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选票种',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'select',
    label: '支付方式',
    prop: 'paymentType',
    editDisabled: true,
    disabled: true,
    dicData: paymentType,
  }, {
    type: 'input',
    showSummary: true,
    label: '售卖张数',
    prop: 'saleNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '票价',
    prop: 'unitTicketPrice',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '售卖金额 ',
    prop: 'saleAmount',
    editDisabled: true,
    disabled: true,
    // }, {
    //
    //   type: 'input',
    //   label: '电子回执单类型 1：转账 2：团购 3：平台 取票方式为线下核销的【0】，赋值3 平台 取票方式为转账的【1】，赋值 1 转账 从团购查询的，赋值2 团购',
    //   prop: 'returnOrderType'
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '折扣后金额',
    prop: 'discountAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "150px",
    label: '银行电子回执单金额',// 银行电子回执单金额 编辑时赋值 转账和团购编辑此值
    prop: 'bankElecOrderAmount',
    rules: [{
      required: true,
      message: '请输入银行电子回执单金额',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "250px",
    label: '银行电子回执单与售卖金额差异',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
    prop: 'diffElecAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "120px",
    label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
    prop: 'bankAccountBalance',
    rules: [{
      required: true,
      message: '请输入银行账户金额',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
     width: "250px",
    label: '银行电子回执单与银行账户金额差异',// 编辑时赋值 转账和团购编辑此值
    prop: 'diffAccountAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'date',
    label: '记账日期',
    prop: 'bookkeepingTime',
    editDisabled: true,
    disabled: true,
    searchSpan: 12,
    searchRange: true,
    search: true,
    searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    type: 'input',
     width: "120px",
    label: '回执单号/订单号',
    prop: 'returnNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '对账状态',
    prop: 'confirmStatus',
    editDisabled: true,
    disabled: true,
    dicData: confirmStatus,
    search: true,
  }]
}

export const orderType3TableOption = {
  ...commonTableOption,
  selection: true,
  menu: true,
  editBtn: false,
  delBtn: false,
  selectable: (row, index) => {
    return (
      row.confirmStatus === '0'
    );
  },
  column: [
    {

      type: 'input',
      label: '唯一标识',
      prop: 'id',
      hide: true,
      display: false
    }, {
      type: 'select',
      label: '线路',
      prop: 'lineCode',
      search: true,
      cascaderItem: ['stationCode'],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: '/support/swparamline/dict',
    }, {
      type: 'select',
      label: '站点',
      prop: 'stationCode',
      search: true,
      props: {
        label: 'name',
        value: 'code'
      },
      dicFlag: false,
      dicUrl: `/support/swparamstation/dict/{{key}}`,
    }, {
      type: 'select',
      label: '票种',
      prop: 'ticketType',
      editDisabled: true,
      disabled: true,
      dicUrl: '/rca/swckelectronicreceipt/ticketType',
      props: {
        label: 'name',
        value: 'code'
      },
      search: true,
      rules: [
        {
          required: false,
          message: '请选票种',
          trigger: 'blur'
        }
      ]
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value)
      },
      label: '票价',
      prop: 'unitTicketPrice',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'select',
      label: '支付方式',
      prop: 'paymentType',
      search: true,
      dicData: paymentType,
      rules: [{
        required: true,
        message: '请选择支付方式',
        trigger: 'blur'
      }],
    }, {
      type: 'input',
      showSummary: true,
      label: '售卖张数',
      prop: 'saleNumber',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '售卖金额 ',
      prop: 'saleAmount',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '邮寄费 ',
      prop: 'mailingCost',
      editDisabled: true,
      disabled: true,
      // }, {
      //
      // type: 'input',
      //   label: '电子回执单类型 1：转账 2：团购 3：平台 取票方式为线下核销的【0】，赋值3 平台 取票方式为转账的【1】，赋值 1 转账 从团购查询的，赋值2 团购',
      //   prop: 'returnOrderType'
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '手续费',// 平台编辑时赋值
      prop: 'handServiceMoney',
      rules: [{
        required: true,
        message: '请输入手续费',
        trigger: 'blur'
      }],
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
       width: "120px",
      label: '扣除手续费后金额',// 平台编辑时赋值 售卖金额-手续费
      prop: 'deductHandServiceMoney',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
       width: "120px",
      label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
      prop: 'bankAccountBalance',
      rules: [{
        required: true,
        message: '请输入银行账户金额',
        trigger: 'blur'
      }],
    }, {
      type: 'input',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '差异金额',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
      prop: 'diffElecAmount',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'date',
      label: '记账日期',
      prop: 'bookkeepingTime',
      editDisabled: true,
      disabled: true,
      searchSpan: 12,
      searchRange: true,
      search: true,
      searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
      format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
      valueFormat: 'yyyy-MM-dd',
    }, {
      type: 'input',
      label: '订单号',
      prop: 'returnNumber',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'select',
      label: '对账状态',
      prop: 'confirmStatus',
      editDisabled: true,
      disabled: true,
      dicData: confirmStatus,
      search: true,
    }]
}

export const tableOptionMap = {
  1: orderType1TableOption,
  2: orderType2TableOption,
  3: orderType3TableOption
}


export const orderType3TableOptionPreview = {
  ...commonTableOption,
  column: [{
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    cascaderItem: ['stationCode'],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dict',
  }, {
    type: 'select',
    label: '站点',
    prop: 'stationCode',
    props: {
      label: 'name',
      value: 'code'
    },
    dicFlag: false,
    dicUrl: `/support/swparamstation/dict/{{key}}`,
  }, {
    type: 'select',
    label: '票种',
    prop: 'ticketType',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckelectronicreceipt/ticketType',
    props: {
      label: 'name',
      value: 'code'
    },
    rules: [
      {
        required: false,
        message: '请选票种',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '票价',
    prop: 'unitTicketPrice',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '支付方式',
    prop: 'paymentType',
    dicData: paymentType,
    rules: [{
      required: true,
      message: '请选择支付方式',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    label: '售卖张数',
    prop: 'saleNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '售卖金额 ',
    prop: 'saleAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '邮寄费 ',
    prop: 'mailingCost',
    editDisabled: true,
    disabled: true,
    // }, {
    //
    // type: 'input',
    //   label: '电子回执单类型 1：转账 2：团购 3：平台 取票方式为线下核销的【0】，赋值3 平台 取票方式为转账的【1】，赋值 1 转账 从团购查询的，赋值2 团购',
    //   prop: 'returnOrderType'
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '手续费',// 平台编辑时赋值
    prop: 'handServiceMoney',
    rules: [{
      required: true,
      message: '请输入手续费',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '扣除手续费后金额',// 平台编辑时赋值 售卖金额-手续费
    prop: 'deductHandServiceMoney',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
    prop: 'bankAccountBalance',
    rules: [{
      required: true,
      message: '请输入银行账户金额',
      trigger: 'blur'
    }],
  }, {
    type: 'input',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '差异金额（银行账户金额-折扣后金额）',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
    prop: 'diffElecAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'date',
    label: '记账日期',
    prop: 'bookkeepingTime',
    editDisabled: true,
    disabled: true,
    searchSpan: 12,
    searchRange: true,
    searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    type: 'input',
    label: '订单号',
    prop: 'returnNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '对账状态',
    prop: 'confirmStatus',
    editDisabled: true,
    disabled: true,
    dicData: confirmStatus,
  }]
}


export const orderType1FormOption = {
  emptyBtn: false,
  column: [{
    type: 'select',
    label: '线路',
    prop: 'lineCode',
    search: true,
    editDisabled: true,
    disabled: true,
    cascaderItem: ['stationCode'],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: '/support/swparamline/dict',
  }, {
    type: 'select',
    label: '站点',
    prop: 'stationCode',
    search: true,
    editDisabled: true,
    disabled: true,
    props: {
      label: 'name',
      value: 'code'
    },
    dicFlag: false,
    dicUrl: `/support/swparamstation/dict/{{key}}`,
  }, {
    type: 'select',
    label: '票种',
    prop: 'ticketType',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckelectronicreceipt/ticketType',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选票种',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'number',
    showSummary: true,
    label: '售卖张数',
    prop: 'saleNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '票价',
    prop: 'unitTicketPrice',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '售卖金额 ',
    prop: 'saleAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单金额',// 银行电子回执单金额 编辑时赋值 转账和团购编辑此值
    prop: 'bankElecOrderAmount',
    rules: [{
      required: true,
      message: '请输入银行电子回执单金额',
      trigger: 'blur'
    }],
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单与售卖金额差异',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
    prop: 'diffElecAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
    prop: 'bankAccountBalance',
    rules: [{
      required: true,
      message: '请输入银行账户金额',
      trigger: 'blur'
    }],
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单与银行账户金额差异',// 编辑时赋值 转账和团购编辑此值
    prop: 'diffAccountAmount',
    editDisabled: true,
    disabled: true,
    showSummary: true,
  }, {
    type: 'date',
    label: '记账日期',
    prop: 'bookkeepingTime',
    editDisabled: true,
    disabled: true,
    searchSpan: 12,
    searchRange: true,
    search: true,
    searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    type: 'input',
    label: '回执单号/订单号',
    prop: 'returnNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '对账状态',
    prop: 'confirmStatus',
    dicData: confirmStatus,
    search: true,
  }]
}

export const orderType2FormOption = {
  emptyBtn: false,
  column: [{
    type: 'select',
    label: '线路名称',
    prop: 'lineCode',
    editDisabled: true,
    disabled: true,
    dicQuery: { allLine: true },
    cascaderItem: ['stationCode'],
    dicUrl: '/rca/swckbankcashpaymentnote/listAllSubWayLine',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选择线路',
        trigger: 'blur'
      }
    ],
  }, {
    type: 'select',
    label: '站点名称',
    prop: 'stationCode',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckbankcashpaymentnote/listSubWayStation?lineCode={{key}}',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选站点',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'select',
    label: '票种',
    prop: 'ticketType',
    editDisabled: true,
    disabled: true,
    dicUrl: '/rca/swckelectronicreceipt/ticketType',
    props: {
      label: 'name',
      value: 'code'
    },
    search: true,
    rules: [
      {
        required: false,
        message: '请选票种',
        trigger: 'blur'
      }
    ]
  }, {
    type: 'select',
    label: '支付方式',
    prop: 'paymentType',
    editDisabled: true,
    disabled: true,
    dicData: paymentType,
  }, {
    type: 'input',
    showSummary: true,
    label: '售卖张数',
    prop: 'saleNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value)
    },
    label: '票价',
    prop: 'unitTicketPrice',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '售卖金额 ',
    prop: 'saleAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '折扣后金额',
    prop: 'discountAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单金额',// 银行电子回执单金额 编辑时赋值 转账和团购编辑此值
    prop: 'bankElecOrderAmount',
    rules: [{
      required: true,
      message: '请输入银行电子回执单金额',
      trigger: 'blur'
    }],
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单与售卖金额差异',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
    prop: 'diffElecAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
    prop: 'bankAccountBalance',
    rules: [{
      required: true,
      message: '请输入银行账户金额',
      trigger: 'blur'
    }],
  }, {
    type: 'number',
    showSummary: true,
    precision: 2,
    formatter: (row, value, label, column) => {
      return rcaNumberFormat(value, true)
    },
    label: '银行电子回执单与银行账户金额差异',// 编辑时赋值 转账和团购编辑此值
    prop: 'diffAccountAmount',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'date',
    label: '记账日期',
    prop: 'bookkeepingTime',
    editDisabled: true,
    disabled: true,
    searchSpan: 12,
    searchRange: true,
    search: true,
    searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
    format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
    valueFormat: 'yyyy-MM-dd',
  }, {
    type: 'input',
    label: '回执单号/订单号',
    prop: 'returnNumber',
    editDisabled: true,
    disabled: true,
  }, {
    type: 'select',
    label: '对账状态',
    prop: 'confirmStatus',
    editDisabled: true,
    disabled: true,
    dicData: confirmStatus,
    search: true,
  }]
}

export const orderType3FormOption = {
  emptyBtn: false,
  column: [
   {
      type: 'select',
      label: '线路',
      prop: 'lineCode',
      search: true,
      editDisabled: true,
      disabled: true,
      cascaderItem: ['stationCode'],
      props: {
        label: 'name',
        value: 'code'
      },
      dicUrl: '/support/swparamline/dict',
    }, {
      type: 'select',
      label: '站点',
      prop: 'stationCode',
      search: true,
      editDisabled: true,
      disabled: true,
      props: {
        label: 'name',
        value: 'code'
      },
      dicFlag: false,
      dicUrl: `/support/swparamstation/dict/{{key}}`,
    }, {
      type: 'select',
      label: '票种',
      prop: 'ticketType',
      editDisabled: true,
      disabled: true,
      dicUrl: '/rca/swckelectronicreceipt/ticketType',
      props: {
        label: 'name',
        value: 'code'
      },
      search: true,
      rules: [
        {
          required: false,
          message: '请选票种',
          trigger: 'blur'
        }
      ]
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value)
      },
      label: '票价',
      prop: 'unitTicketPrice',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'select',
      label: '支付方式',
      prop: 'paymentType',
      search: true,
      dicData: paymentType,
      rules: [{
        required: true,
        message: '请选择支付方式',
        trigger: 'blur'
      }],
    }, {
      type: 'number',
      showSummary: true,
      label: '售卖张数',
      prop: 'saleNumber',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '售卖金额 ',
      prop: 'saleAmount',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '邮寄费 ',
      prop: 'mailingCost',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '手续费',// 平台编辑时赋值
      prop: 'handServiceMoney',
      rules: [{
        required: true,
        message: '请输入手续费',
        trigger: 'blur'
      }],
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '扣除手续费后金额',// 平台编辑时赋值 售卖金额-手续费
      prop: 'deductHandServiceMoney',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '银行账户金额',// 编辑时赋值、转账、团购和平台编辑此值
      prop: 'bankAccountBalance',
      rules: [{
        required: true,
        message: '请输入银行账户金额',
        trigger: 'blur'
      }],
    }, {
      type: 'number',
      showSummary: true,
      precision: 2,
      formatter: (row, value, label, column) => {
        return rcaNumberFormat(value, true)
      },
      label: '差异金额',// 编辑时赋值 转账和团购和平台编辑此值 (平台借用此字段 银行账户金额-扣除手续费金额）
      prop: 'diffElecAmount',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'date',
      label: '记账日期',
      prop: 'bookkeepingTime',
      editDisabled: true,
      disabled: true,
      searchSpan: 12,
      searchRange: true,
      search: true,
      searchValue: [startDate, endDate],      // 这是我获取的默认的显示日期，我这里是['2020-08-04', '2020-09-22']
      format: 'yyyy-MM-dd',                  // 这是组件展示的日期格式
      valueFormat: 'yyyy-MM-dd',
    }, {
      type: 'input',
      label: '订单号',
      prop: 'returnNumber',
      editDisabled: true,
      disabled: true,
    }, {
      type: 'select',
      label: '对账状态',
      prop: 'confirmStatus',
      editDisabled: true,
      disabled: true,
      dicData: confirmStatus,
      search: true,
    }]
}

export const formOptionMap = {
  1: orderType1FormOption,
  2: orderType2FormOption,
  3: orderType3FormOption
}
